/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.sorbonne.soa.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Nairo
 */
@Entity
@Table(name = "INVOICE")
@NamedQueries({@NamedQuery(name = "Invoice.findAll", query = "SELECT i FROM Invoice i"), @NamedQuery(name = "Invoice.findByInvoiceid", query = "SELECT i FROM Invoice i WHERE i.invoiceid = :invoiceid"), @NamedQuery(name = "Invoice.findByOrderid", query = "SELECT i FROM Invoice i WHERE i.orderid = :orderid"), @NamedQuery(name = "Invoice.findByInvoicetype", query = "SELECT i FROM Invoice i WHERE i.invoicetype = :invoicetype"), @NamedQuery(name = "Invoice.findByAmount", query = "SELECT i FROM Invoice i WHERE i.amount = :amount"), @NamedQuery(name = "Invoice.findByIspaid", query = "SELECT i FROM Invoice i WHERE i.ispaid = :ispaid")})
public class Invoice implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "INVOICEID")
    private String invoiceid;
    @Basic(optional = false)
    @Column(name = "ORDERID")
    private String orderid;
    @Basic(optional = false)
    @Column(name = "INVOICETYPE")
    private String invoicetype;
    @Column(name = "AMOUNT")
    private Double amount;
    @Basic(optional = false)
    @Column(name = "ISPAID")
    private int ispaid;

    public Invoice() {
    }

    public Invoice(String invoiceid) {
        this.invoiceid = invoiceid;
    }

    public Invoice(String invoiceid, String orderid, String invoicetype, int ispaid) {
        this.invoiceid = invoiceid;
        this.orderid = orderid;
        this.invoicetype = invoicetype;
        this.ispaid = ispaid;
    }

    public String getInvoiceid() {
        return invoiceid;
    }

    public void setInvoiceid(String invoiceid) {
        this.invoiceid = invoiceid;
    }

    public String getOrderid() {
        return orderid;
    }

    public void setOrderid(String orderid) {
        this.orderid = orderid;
    }

    public String getInvoicetype() {
        return invoicetype;
    }

    public void setInvoicetype(String invoicetype) {
        this.invoicetype = invoicetype;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public int getIspaid() {
        return ispaid;
    }

    public void setIspaid(int ispaid) {
        this.ispaid = ispaid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (invoiceid != null ? invoiceid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Invoice)) {
            return false;
        }
        Invoice other = (Invoice) object;
        if ((this.invoiceid == null && other.invoiceid != null) || (this.invoiceid != null && !this.invoiceid.equals(other.invoiceid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.sorbonne.soa.entity.Invoice[invoiceid=" + invoiceid + "]";
    }

}
